<%-- 
    Document   : class-manage
    Created on : Feb 14, 2012, 10:42:23 AM
    Author     : PhucAn
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include  file="../handler/class-manage-action.jsp" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Class management</title>
        <script type="text/javascript">
            function select(idx){     
              document.getElementById("selected-id").value=idx;
              document.forms[0].submit();
            }
        </script>
    </head>
    <body>
        <form action="#" method="post">
          
            <table class="data-table">
                <tr>
                    <th>Class name</th>
                    <th>Created date</th>
                    <th>Public</th>
                    <th>Created by</th>
                    <th></th>
                </tr>
                <c:forEach  var="cls" items="${list}">
                <tr>
                    <td>${cls.name}</td>
                    <td>${cls.createdDate}</td>
                    <td></td>
                    <td></td>
                    <td>
                        <a href="?pcontent=modify-class&classid=${cls.id}">Edit</a> | 
                        <a href="javascript:showConfirm();">Delete</a> - 
                        <a href="javascript:select(${cls.id})">Select</a>
                    </td>                    
                </tr>
                </c:forEach>
            </table>
            <div class="confirm-box">
                <div>Are you sure want to continue?</div>
                <input type="submit" name="delete" value="Delete"/>
                <input type="button" name="hide" value="Hide" onclick="hideConfirm();"/>
            </div>
            <input type="hidden" id="selected-id" name="selected-id"/>
        </form>
        <a href="?pcontent=add-class">+ Add new class ...</a>
    </body>
</html>
